package net.minecraft.src;

import java.util.Random;

public class PPHGenSpiderBurrows extends WorldGenerator
{

    public PPHGenSpiderBurrows()
    {
    }

    public boolean generate(World world, Random random, int i, int j, int k)
    {
	if(world.getBlockId(i, j, k) == mod_pph.prehistoricGrass.blockID && world.getBlockId(i, j - 3, k) == mod_pph.prehistoricDirt.blockID)
	{
	for(int width = -3; width < 3; width++)
	{
		for(int height = -10; height < 0; height++)
		{
			for(int depth = -2; depth < 2; depth++)
			{
				world.setBlock(i+width, j+height, k+depth, 0);
			}
		}
	}
	for(int width = -2; width < 2; width++)
	{
		for(int height = -10; height < 0; height++)
		{
			for(int depth = -3; depth < 3; depth++)
			{
				world.setBlock(i+width, j+height, k+depth, 0);
			}
		}
	}
	for(int width = -2; width < 2; width++)
	{
		for(int height = -11; height < -10; height++)
		{
			for(int depth = -2; depth < 2; depth++)
			{
				world.setBlock(i+width, j+height, k+depth, 0);
			}
		}
	}
	for(int width = -3; width < 3; width++)
	{
		for(int height = -6; height < -4; height++)
		{
			for(int depth = -3; depth < 3; depth++)
			{
				if(random.nextInt(2) == 0)
				{
					world.setBlock(i+width, j+height, k+depth, Block.web.blockID);
				}
			}
		}
	}
	for(int width = -3; width < 3; width++)
	{
		for(int height = 0; height < 1; height++)
		{
			for(int depth = -3; depth < 3; depth++)
			{
				world.setBlock(i+width, j+height, k+depth, mod_pph.grassTrap.blockID);
			}
		}
	}
	for(int width = -3; width < 3; width++)
	{
		for(int height = -10; height < -7; height++)
		{
			for(int depth = -3; depth < 3; depth++)
			{
				if(random.nextInt(50) == 0)
				{
					world.setBlock(i+width, j+height, k+depth, mod_pph.prehistoricSpawner.blockID);
				}
			}
		}
	}
	for(int width = -10; width < 10; width++)
	{
		for(int height = 0; height < 10; height++)
		{
			for(int depth = -10; depth < 10; depth++)
			{
				if(world.isAirBlock(i+width, j+height, k+depth) && (world.getBlockMaterial(i+width, j+height-1, k+depth).isSolid() || world.getBlockMaterial(i+width, j+height+1, k+depth).isSolid() || world.getBlockMaterial(i+width+1, j+height, k+depth).isSolid() || world.getBlockMaterial(i+width-1, j+height, k+depth).isSolid() || world.getBlockMaterial(i+width, j+height, k+depth+1).isSolid() || world.getBlockMaterial(i+width, j+height, k+depth-1).isSolid()))
				{
					if(random.nextInt(250) == 0)
					{
						world.setBlock(i+width, j+height, k+depth, Block.web.blockID);
					}
				}
			}
		}
	}
	}
		return true;
	}
}